//
//  EFBDigestViewController.m
//  muefb
//
//  Created by EFB on 14-6-3.
//
//

#import "EFBDigestViewController.h"

@interface EFBDigestViewController ()

@end

@implementation EFBDigestViewController

@synthesize digestTableView = _digestTableView;

- (void)dealloc
{
    [_digestTableView release];
//    [_dataSourceArray release];
    [super dealloc];
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.digestTableView.delegate = self;
    self.digestTableView.dataSource = self;
    self.digestTableView.backgroundColor = [UIColor colorWithRed:59/255.0 green:70/255.0 blue:85/255.0 alpha:1.0];
    self.digestTableView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);
//    self.dataSourceArray = [NSArray arrayWithObjects:@"校核单",@"修订单", nil];
//    self.digestTableView.backgroundColor = [UIColor blackColor];
    self.digestTableView.scrollEnabled = NO;
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    self.preferredContentSize = CGSizeMake(100, [self.dataSourceArray count]*44);
}

#pragma mark tableview Data source-----
//给航图分类   并加载显示

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 44.0;
}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
    
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [self.dataSourceArray count];
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *chartsListIdentifier=@"chartsListIdentifier";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:chartsListIdentifier];
    
    if (cell==nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:chartsListIdentifier] autorelease];
    }
    cell.textLabel.font = [UIFont systemFontOfSize:15.0f];
    cell.textLabel.text = [self.dataSourceArray objectAtIndex:[indexPath row]];
    cell.textLabel.textAlignment = NSTextAlignmentCenter;
    cell.textLabel.textColor = [UIColor whiteColor];
    cell.selectedBackgroundView =[[[UIView alloc] initWithFrame:cell.frame] autorelease];
    cell.selectedBackgroundView.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"cell60.png"]];

    return cell;
}


-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [self.delegate didSelectedRowForShowPdfName:[self.dataSourceArray objectAtIndex:[indexPath row]]];
    [self.digestTableView deselectRowAtIndexPath:indexPath animated:YES];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
